﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EntModApp.EntServices.Data
{
  public interface IDataRepository<TEntity, TQuery>
    : IUnitOfWork
    where TEntity : class
    where TQuery : class
  {
    IEnumerable<TEntity> RetrieveAll();
    IEnumerable<TEntity> RetrieveAll(out int total, bool retrieveTotal);
    IEnumerable<TEntity> Retrieve(TQuery query, out int total);

    int Count();
    int Count(TQuery query);

    TEntity New();
//    TDerived New<TDerived>() where TDerived: class, TEntity;
    TEntity Create(TEntity entity);
    TEntity Update(TEntity entity);
    void Delete(TEntity entity);
  }
}
